//首页服务item
import 'package:color_dart/RgbaColor.dart';
import 'package:flutter/material.dart';
import 'package:im_flutter_sdk_example/jsonserialize/serve/data.dart';
import 'package:im_flutter_sdk_example/utils/global.dart';

class HomeServeItem extends StatelessWidget {
  final ServeData item;
  const HomeServeItem({Key key, this.item}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      onTap: () => {G.pushNamed('/serve_detail', arguments: item)},
      child: Container(
        width: G.screenWidth() * 0.43,
        height: 225,
        margin: EdgeInsets.only(right: 10),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Container(
              width: G.screenWidth() * 0.43,
              height: 115,
              decoration: BoxDecoration(
                borderRadius: BorderRadius.all(Radius.circular(5)),
              ),
              child: Image.network(
                G.fullImgPath(item.advertisingMap),
                fit: BoxFit.cover,
              ),
            ),
            Padding(
              padding: EdgeInsets.fromLTRB(0, 11, 0, 6),
              child: Text(
                '${item.serviceName}',
                maxLines: 1,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(
                    color: rgba(51, 51, 51, 1),
                    fontSize: 15,
                    fontWeight: FontWeight.w500),
              ),
            ),
            Text('${item.userInforCompany.realName}',
                maxLines: 1,
                overflow: TextOverflow.ellipsis,
                style: TextStyle(
                  color: rgba(191, 191, 191, 1),
                  fontSize: 12,
                )),
            Padding(
              padding: EdgeInsets.only(top: 8),
              child: Row(
                children: [
                  Text(
                    '¥${item.price}',
                    style: TextStyle(color: rgba(255, 109, 1, 1), fontSize: 17),
                  )
                ],
              ),
            )
          ],
        ),
      ),
    );
  }
}
